﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Results.aspx.cs" Inherits="KnowFirstWebApplication.Results" MasterPageFile="~/Site1.Master" EnableSessionState="ReadOnly"  MaintainScrollPositionOnPostback="True" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolder1" ID="ResultsContent">

    <asp:UpdatePanel runat="server">
<ContentTemplate>
<strong style="background-color: #CF4342; color: #FFFFFF; position: fixed; top:0px; right:0px"  >
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="100">
        <ProgressTemplate>
           <img 
                src="App_Themes/GeneralTheme/ajax-loader.gif" />טוען.....
                </ProgressTemplate>
                </asp:UpdateProgress>
</strong>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div ID="CategoriesTitle" style="vertical-align: middle; text-align: right">
        <h3 dir="rtl" style="color: #996633">
            תוצאות:</h3>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div ID="queriesAndCategories">
                <table dir="rtl">
                    <tr>
                        <td>
                            <div ID="categorySelection" class="querySelectionDivs">
                                <asp:Label ID="Label3" runat="server" Text="בחר קטגוריה"></asp:Label>
                                <br />
                                <asp:ListBox ID="lbCategories" runat="server" AutoPostBack="True" 
                                    Height="110px" onselectedindexchanged="lbCategories_SelectedIndexChanged" 
                                    Width="180px"></asp:ListBox>
                            </div>
                        </td>
                        <td>
                            <div ID="querySelection" class="querySelectionDivs">
                                <asp:Label ID="Label4" runat="server" Text="בחר נושאים"></asp:Label>
                                <br />
                                <asp:ListBox ID="lbQueries" runat="server" Height="110px" Width="180px">
                                </asp:ListBox>
                            </div>
                        </td>
                        <td>
                            <div ID="TopicAddRemoveButtons" class="querySelectionDivs">
                                <asp:Button ID="btnAddQuery" runat="server" name="btnAdd" 
                                    onclick="btnAddQuery_Click" style="width: 55px" Text="הוסף" />
                                <br />
                                <asp:Button ID="btnRemoveQuery" runat="server" name="btnRemove" 
                                    onclick="btnRemoveQuery_Click" style="width: 55px" Text="הסר " />
                            </div>
                        </td>
                        <td>
                            <div ID="selectedQueries" class="querySelectionDivs">
                                <asp:Label ID="Label5" runat="server" Text="נושאים נבחרים"></asp:Label>
                                <br />
                                <asp:ListBox ID="lbSelectedQueries" runat="server" Height="110px" Width="180px">
                                </asp:ListBox>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div ID="pre-results" dir="rtl" style="margin-top: 20px; margin-bottom: 20px">
        <asp:CheckBoxList ID="cblDocumentTypes" runat="server" AutoPostBack="True" 
            Height="16px" onselectedindexchanged="cblDocumentTypes_SelectedIndexChanged" 
            RepeatDirection="Horizontal" Width="315px">
        </asp:CheckBoxList>
        <span ID="dateSelect" style="word-spacing: 0.5em; line-height: normal;">
        <asp:Label ID="Label1" runat="server" Text=" מתאריך "></asp:Label>
        <asp:DropDownList ID="cbFromYear" runat="server" />
        <asp:DropDownList ID="cbFromMonth" runat="server" />
        <asp:DropDownList ID="cbFromDay" runat="server" />
        <asp:Label ID="Label2" runat="server" Text=" עד "></asp:Label>
        <asp:DropDownList ID="cbToYear" runat="server" />
        <asp:DropDownList ID="cbToMonth" runat="server" />
        <asp:DropDownList ID="cbToDay" runat="server" />
        <asp:Button ID="btnLoadCategory" runat="server" onclick="btnLoadCategory_Click" 
            Text="הצג תוצאות" Width="121px" />
        </span>
        <br />
        <asp:CheckBox ID="cbOnlyUnread" runat="server" AutoPostBack="True" 
            oncheckedchanged="cbOnlyUnread_CheckedChanged" 
            Text="הצג רק תוצאות שלא נשלחו בהתראה" />
        <br />
        <asp:Label ID="lblCategoryName" runat="server"></asp:Label>
    </div>
    <div ID="results" dir="rtl">
        <asp:ListView ID="lvCategoryResults" runat="server" DataKeyNames="ID" 
            OnPagePropertiesChanging="lvCategoryResults_PagePropertiesChanging" 
            onselectedindexchanged="lvCategoryResults_SelectedIndexChanged">
            <LayoutTemplate>
                <span ID="itemPlaceholder" runat="server"></span>
                <table ID="groupPlaceholder" runat="server">
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <!-- Hover Menu + Popup Panel -->
                <cc1:HoverMenuExtender ID="hme2" runat="Server" HoverCssClass="popupHover" 
                    OffsetX="0" OffsetY="0" PopDelay="0" PopupControlID="PopupMenu" 
                    PopupPosition="Left" TargetControlID="TitleHyperLink" />
                <asp:Panel ID="PopupMenu" runat="server" BackColor="#DDE4EA" BorderColor="Black" 
                    BorderStyle="Double" CssClass="popupMenu" Height="200px" ScrollBars="Vertical" 
                    Width="200px">
                    <asp:Label ID="lblContent" runat="server" 
                        Text='<%# (((string)Eval("Text")).Length == 0)? Eval("Title") : Eval("Text")%>'></asp:Label>
                </asp:Panel>
                <!-- Result controls --><span ID="datetime"><%# Eval("DateTime") %> </span>-
                <asp:Label ID="lblDocType" runat="server"> <%# Common.Document.DocumentTypeToString((Common.Document.Type)Eval("DocType")) %> </asp:Label>
                <asp:DropDownList ID="cbSentiment" runat="server" AutoPostBack="True" 
                    OnSelectedIndexChanged="lvCategoryResults_SelectedIndexChanged">
                    <asp:ListItem Selected="True">ניטראלי</asp:ListItem>
                    <asp:ListItem>חיובי</asp:ListItem>
                    <asp:ListItem>שלילי</asp:ListItem>
                </asp:DropDownList>
                <%# Eval("SentimentId") %>
                <asp:Label ID="lblNbcResult" runat="server"></asp:Label>
                <br />
                <span ID="talkbackNumber">
                <%# ((int)Eval("talkbackNumber") > 0) ? Eval("talkbackNumber") : "" %> </span>-
                <asp:HyperLink ID="TitleHyperLink" runat="server" 
                    NavigateUrl='<%# Eval("url") %>' Target="_blank" 
                    Text='<%#(((string)Eval("Title")).Length < 2)? "ללא כותרת" : Eval("Title") %>'>   </asp:HyperLink>
                <br />
                <%# KnowFirstWebApplication.UIHelper.ArrangeExcerpts(Eval("excerpts") as string[]) %>
                <span style="color: Green"><%#Eval("DisplayNameProperty") %> -
                <asp:Label runat="server" Text='<%# Eval("Url") %>'> </asp:Label>
                </span>
            </ItemTemplate>
            <ItemSeparatorTemplate>
                <br />
                <br />
            </ItemSeparatorTemplate>
        </asp:ListView>
        <br />
        <div ID="pager" dir="ltr" style="text-align: center">
            <asp:DataPager ID="ResultsDataPager" runat="server" 
                onprerender="ResultsDataPager_PreRender" PagedControlID="lvCategoryResults" 
                PageSize="20">
                <Fields>
                    <asp:NumericPagerField ButtonCount="10" NextPageText="&gt;" 
                        PreviousPageText="&lt;" />
                </Fields>
            </asp:DataPager>
        </div>
    </div>

</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>